<template>
  <svg :class="['svg-icon', className]" aria-hidden="true">
    <use :xlink:href="handleiconName" />
  </svg>
</template>

<script>
export default {
  name: 'svgIcon',
  props: {
    iconName: {
      type: String,
      required: true
    },
    className: {
      type: String,
      default: ''
    }
  },
  computed: {
    handleiconName() {
      return `#icon-${this.iconName}`
    }
  }
}
</script>

<style lang="scss" scoped>
.svg-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  overflow: hidden;
}
</style>
